package ua.kpi_java_training.tyshchenko.module2.test;

import static junit.framework.Assert.*;
import org.junit.Before;
import org.junit.Test;
import ua.kpi_java_training.tyshchenko.module2.*;

/**
 * @author Vlad Tyshchenko
 * @version 1.0 5 June 2013
 */
public class PredatorTest {
    Predator pre;

    @Before
    public void setUp() {
        pre = new Predator(new Habitat(new StabInputAllData()));
    }

    @Test
    public void testCheckBirth() {
        assertFalse(pre.checkBirth());
        for (int i = 0; i < 5; i++) {
            pre.addCountNewLife();
        }
        assertTrue("add new predator ", pre.checkBirth());

    }

    @Test
    public void testGetNewFish() {
        assertTrue("check type new predator ", pre.getNewFish() instanceof CreatureInHabitat);
        assertTrue("check type new predator ", pre.getNewFish() instanceof Predator);
        assertFalse("check type new predator ", pre.getNewFish() instanceof Victim);

    }
}
